package com.kiku.user.web;


import com.kiku.user.pojo.User;
import com.kiku.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;


/**
 * @author Kiku
 * @date 2019/6/12 16:09
 */

@RestController
@Slf4j
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/{id}")
    @ResponseBody
    public User queryById(@PathVariable("id") Integer id){
        User user = userService.queryById(id);
        return user;
    }
}
